<include file="./Public/layout/header" />
<script type="text/javascript" src="__BASE__/Public/js/jquery.form.js"></script>

<script>
$(document).ready(function(){
	weibo.init();
})

function close_announcement() {
	$('#announcement').hide('slow');
}
</script>
<div class="content"><!-- 内容 begin  --> 
  <div class="main">
    <div class="mainbox">
      <div class="mainbox_R"> 
        <div class="right_box">
          <h2>关注的话题</h2>
          <ul class="topic_list" rel="followTopicArea">
          </ul>
          <div class="alR lh25"><a href="javascript:void(0)" onclick="$('.quick_win').show()">+添加</a></div>
        </div>
      </div>
      <div class="mainbox_C">
      <div style="overflow:hidden;">
        <div class="talkBox">
          <form method="post" action="{:U('Tweet/save')}" id="miniblog_publish" oncomplete="false">
            <input type="hidden" name="publish_type" value="0">
            <h2>
              <div class="wordNum">你还可以输入<strong id="strconunt">140</strong>字</div>
            </h2>
            <div class="dateBox">
            	<input id="datePicker" class="Wdate" type="text" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',minDate:'%y-%M-%d {%H+1}:%m:%s'})"/> 时发送</div>
            <div class="cntBox">
              <textarea name="content" id="content_publish" cols="" rows=""style="width:99.3%;_width:99%; height:78px;padding:5px 0;"></textarea>
              <div class="txtShadow" style="z-index:-1000"></div>
            </div>
            <div class="funBox">
              <div class="right" style="padding-bottom:5px;"> 
                <input type="button"  onclick="document.getElementById('miniblog_publish').submit();" class="btn_big_disable hand" value="&nbsp;" id="publish_handle"  />
              </div>
              <div class="left" id="publish_type_content_before">
              	<span>添加：</span>
              	<a class="a52" onclick="ui.emotions(this)" target_set="content_publish" href="javascript:void(0)">
              		<img src="__BASE__/Public/images/zw_img.gif" class="icon_add_face_d">表情</a> 
              	<a class="a52" onclick="addtheme()" href="javascript:void(0)">
              		<img src="__BASE__/Public/images/zw_img.gif" class="icon_add_topic_d">话题</a> 
              	<a class="a52" onclick="weibo.plugin.image.click(169)" href="javascript:void(0)">
              		<img src="__BASE__/Public/images/zw_img.gif" class="icon_add_img_d">图片</a> 
              	<a class="a52" onclick="weibo.plugin.video.click(221)" href="javascript:void(0)">
              		<img src="__BASE__/Public/images/zw_img.gif" class="icon_add_video_d">视频</a> 
              	<a class="a52" onclick="weibo.plugin.music.click(271)" href="javascript:void(0)">
              		<img src="__BASE__/Public/images/zw_img.gif" class="icon_add_music_d">音乐</a>
              	</div>
            </div>
          </form>
        </div>
            <div class="tab-menu"><!-- 切换标签 begin  -->
              <ul>
                <li><a id="feed_colleague_item" rel="colleague" class="on feed_item" href=""><span>未发送</span></a></li>
                <li><a id="feed_colleague_item" rel="colleague" class=" feed_item" href=""><span>已发送</span></a></li>
                <li><a id="feed_colleague_item" rel="colleague" class=" feed_item" href=""><span>发送失败</span></a></li>
              </ul>
            </div>
        <div class="feedBox">
          <div id="countNew"> </div>
          <ul class="feed_list" >
          </ul>
		  
		  	<p class="page">list.html</p>
          	<p class="moreFoot"><a href="javascript:void(0)" onclick="loadmore(this)">更多</a></p>
        </div>
        
        </div>
        <div class="c"></div>
      </div>
    </div>
  </div>
</div>
<!-- 内容 end --> 
<script>
$(document).ready(function(){
	//微博字数控制
	//更新最新的微博数
	setInterval("countNew()",120000);
});


//同步设置
function selectSync(o){
	if( o.checked ){
		$(o).removeAttr('checked');
		$.get( null ,{type:$(o).val()},function(txt){
			if(txt=='1'){
				$(o).attr('checked','true');
			}else{
				ui.box.show(txt,{title:'绑定帐号'});
			}
		});		
	}else{
		$(o).attr('checked',true);
		$.post( null ,{value:$(o).val()},function(txt){
			$(o).removeAttr('checked');
		});	
	} 
}

//获取未读取的条数
function countNew(){
	$.post(null,{lastId:lastId,showfeed:showfeed},function(txt){
		if(txt.indexOf('<TSAJAX>')==0) {
			if(txt.indexOf('<HASNEW>')!=-1) {
				$('#countNew').html(txt);
			}
		}else{
			location.reload();
		}
	})
}

//加载未读取的微博
function loadNew(pLastId,limit,showfeed){
	$.post(null,{since:pLastId,limit:limit,showfeed:showfeed},function(txt){
		if(txt.indexOf('<TSAJAX>')==0){
			if(txt.indexOf('<HASNEW>')!=-1) {
	            lastId = pLastId;
	            $('#countNew').html('');
	            $('.feed_list').prepend(txt);
			}
		}else{
			location.reload();
		}
			
	})
}

//加载更多
function loadmore(o){
}


//更改动态显示
function changeFeedShowStatus(o){
		var Days = 30;  
	    var exp  = new Date();  
	    exp.setTime(exp.getTime() + Days*24*60*60*1000);	
	if( o.checked ){
	    document.cookie = "feed=1;expires=" + exp.toGMTString(); 
		location.reload();
	}else{
		document.cookie = "feed=0;expires=" + exp.toGMTString(); 
		location.reload();
	}
}

function deleteMini(id) {
}

function setSearchUser(txt){
		alert(txt);
		reg = /@[^@\s]{1,20}$/g
		var   patt   =   new   RegExp(reg);
		var result = patt.exec( txt.val() );
		if(!result) return false;
		var textArea = document.getElementById('content_publish');
		var key = result.toString().replace('@','');

		$(".txtShadow").html('@' + '<span id="showTips"></span>');
		var p = $("#showTips").offset();
				$('#searchUser').css({
					top: p.top + 5,
					left: p.left
				});
		$('#searchUser').find('dl').html('<dt>你想用@提到谁？</dt><dt>test</dt>');
		$('#searchUser').show();
				
		/**
		$.get( U('weibo/Index/searchuser',['n='+key]),function(txt){
			if (txt!='null') {
				txt = eval("(" + txt + ")");
				var html = '';
				$.each(txt, function(i, n){
					html += '<dt>' + n.uname + '</dt>';
				});
				$(".txtShadow").html('@' + '<span id="showTips"></span>');
				var p = $("#showTips").offset();
				$('#searchUser').css({
					top: p.top + 5,
					left: p.left
				});
				$('#searchUser').find('dl').html('<dt>你想用@提到谁？</dt>' + html);
				$('#searchUser').show();
			}
		});
		**/
			
			//$('#searchUser').hide();
}


</script> 
<!-- 用@提到的人 begin-->
<div class="atwho" id="searchUser" style="display:none;">
  <dl>
    
    <!--
                <dd class="ucr">张小小</dd>
                <dd>张大妮</dd>
                <dd>冷大少</dd>
				-->
    
  </dl>
</div>
<!-- 用@提到的人 end --> 


<include file="./Public/layout/footer" /> 